/*
 * @(#)ItunesFile.java
 * 
 * Copyright(C) 2004 Yujin Kim
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package com.netexplode.jtunes.model.media;

import java.io.File;

import org.cdavies.itunes.Track;

/**
 * <code>ItunesFile</code> represents .....
 * 
 * @author ykim
 * @version $Revision: 1.2 $
 * @since 0.1
 */
public class ItunesFile implements MediaFile {

    private ItunesTag tag;

    private Track track;

    public ItunesFile(Track track) {
        this.track = track;
        this.tranformTag();
    }

    private void tranformTag() {
        tag = new ItunesTag();
        tag.setAlbum(track.getAlbumName());
        tag.setArtist(track.getArtistName());
        // tag.setComment();
        tag.setGenre(track.getGenre());
        tag.setTitle(track.getTrackName());
        // tag.setTotalTracks();
        tag.setTrackNumber(track.getTrackNumber());
        // tag.setYear();

        // track.getFormat()
        // track.getDatabaseId()
        // track.getLength()
        // track.getRating()
        // track.getTrackId()
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.netexplode.jtunes.model.media.MediaFile#getFile()
     */
    public File getFile() {
        // TODO Auto-generated method stub
        return null;
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.netexplode.jtunes.model.media.MediaFile#getTag()
     */
    public Tag getTag() {
        // TODO Auto-generated method stub
        return tag;
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.netexplode.jtunes.model.media.MediaFile#getMetadata()
     */
    public Metadata getMetadata() {
        // TODO Auto-generated method stub
        return null;
    }

    /**
     * @return Returns the track.
     */
    public Track getTrack() {
        return this.track;
    }

    /**
     * @param track
     *            The track to set.
     */
    public void setTrack(Track track) {
        this.track = track;
    }

    public String getFormat() {
        return this.track.getFormat();
    }
}